package cn.initcap.designpattern.pattern.behavioral.strategy;

/**
 * @author initcap
 * @date Created in 2018/10/14 PM6:30.
 */
public class PromotionActivity {

    private PromotionStrategy promotionStrategy;

    public PromotionActivity(PromotionStrategy promotionStrategy) {
        this.promotionStrategy = promotionStrategy;
    }

    public PromotionActivity(String strategy) {
        this.promotionStrategy = PromotionStrategyFactory.getPromotionStrategy(strategy);
    }

    public PromotionActivity(StrategyType strategyType) {
        this.promotionStrategy = AnnotationStrategyFactory.getStrategy(strategyType);
    }

    public void executePromotionStrategy() {
        promotionStrategy.doPromotion();
    }

}
